package com.school.information.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.school.information.core.security.entity.BaseEntity;
import com.school.information.enums.status.EnabledEnum;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sys_user")
public class SysUserEntity extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 真实姓名
     */
    @NotBlank(message = "真实姓名不能为空")
    @Length(max = 20, message = "真实姓名最大长度为20个字符")
    private String realName;

    /**
     * 密码
     */
    @JSONField(serialize = false)
    private String password;

    /**
     * 性别 1男 2女
     */
    private Integer gender;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Length(max = 20, message = "手机号最大长度为20个字符")
    private String phone;

    /**
     * 电子邮箱
     */
    private String email;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否启用 0启用 1禁用
     */
    private EnabledEnum isEnabled;
}
